/**
 * 
 */
package de.mbenning.fsim.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @author Martin.Benning
 *
 */
@Entity
@Table (name = "ORGANISATION")
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class Organisation implements Serializable {

	private static final long serialVersionUID = 6219216405013832256L;
	
	@Id
	@GeneratedValue (strategy = GenerationType.TABLE)
	@Column (name = "ID", updatable = false, nullable = false)
	private Integer id;

	@Column (name = "NAME", length = 30, unique = true)
	protected String name;
	
	@ManyToOne (fetch = FetchType.EAGER, cascade = CascadeType.ALL)
	@JoinColumn (name = "ADRESSE_ID")
	private Adresse adresse;
	
	@Column (name = "TELEFON", length = 30)
	private String telefon;
	
	@Column (name = "FAX", length = 30)
	private String fax;
	
	@Column (name = "EMAIL", length = 255)
	private String email;
	
	@Column (name = "INTERNET", length = 255)
	private String internet;
	
	@Column (name = "GRUENDUNGSDATUM")
	private Date gruendungsdatum;
	
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public Adresse getAdresse() {
		return adresse;
	}

	public void setAdresse(Adresse adresse) {
		this.adresse = adresse;
	}
	
	public String getTelefon() {
		return telefon;
	}

	public void setTelefon(String telefon) {
		this.telefon = telefon;
	}

	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getInternet() {
		return internet;
	}

	public void setInternet(String internet) {
		this.internet = internet;
	}
	
	public Date getGruendungsdatum() {
		return gruendungsdatum;
	}

	public void setGruendungsdatum(Date gruendungsdatum) {
		this.gruendungsdatum = gruendungsdatum;
	}

}
